package com.gzyj.jtt808.v2013.enums;

import lombok.Getter;

/**
 * @author lhj
 */
@Getter
public enum TerminalRegisterResult {
    成功(0x00, "成功"),
    车辆已被注册(0x01, "车辆已被注册"),
    数据库中无该车辆(0x02, "数据库中无该车辆"),
    终端已被注册(0x03, "终端已被注册"),
    数据库中无该终端(0x04, "数据库中无该终端"),
    ;

    private int code;
    private String name;

    TerminalRegisterResult(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static TerminalRegisterResult find(int code) {
        for (TerminalRegisterResult result : TerminalRegisterResult.values()) {
            if (result.getCode() == code) {
                return result;
            }
        }
        return null;
    }

}